package playground;

import java.util.List;

import com.echonest.api.v4.EchoNestAPI;
import com.echonest.api.v4.EchoNestException;
import com.echonest.api.v4.Params;
import com.echonest.api.v4.Song;

public class EchoNestConnection implements Runnable {

	private EchoNestAPI echoNest;
	
	public EchoNestConnection(){
		echoNest = new EchoNestAPI("QTJ926WQJ92B089WB");
		echoNest.setTraceSends(false);
		echoNest.setTraceRecvs(false);
	}
	
	public List<Song> searchAllSongsByArtistAndTitle(String artist,String title)
	throws EchoNestException {
		Params p = new Params();
		p.add("artist", artist);
		p.add("title", title);
		p.add("results", 10);

		List<Song> songs = echoNest.searchSongs(p);
		return songs;
	}

	public void run() {
		
	}

}
